<html>
<head>
    <title>RPC管理控制台</title>
    <#include "/common/import.ftl" >
    <script>
        //添加tab页面
        function addTab(title, url) {
            if ($('#maintabs').tabs('exists', title)) {
                $.messager.confirm('确认', '确定要刷新标签页： <font color=red>' + title + '</font> 吗?',
                        function (flag) {
                            if (flag) {
                                var content = '<iframe scrolling="auto" frameborder="0"  src="'
                                        + url
                                        + '" style="width:100%;height:100%;"></iframe>';
                                var tab = $('#maintabs').tabs('getTab',
                                        title);
                                $('#maintabs').tabs('update', {
                                    tab: tab,
                                    options: {
                                        title: title,
                                        content: content,
                                        closable: true
                                    }
                                });
                                $('#maintabs').tabs('select', title);
                            }
                        });
            } else {
                var content = '<iframe scrolling="auto" frameborder="0"  src="'
                        + url + '" style="width:100%;height:100%;"></iframe>';
                $('#maintabs').tabs('add', {
                    title: title,
                    content: content,
                    closable: true
                });
            }
        }

        //用户退出
        function lgnout() {
            $.messager.confirm('提示', '您确定工作已经保存,并退出该系统?', function (r) {
                if (r) {
                    var outUrl = '${ctx}/passport/logout/logout.action';
                    var mainPage = '${ctx}';
                    $.ajax({
                        url: outUrl,
                        type: 'post',
                        success: function (result) {
                            // var result = jQuery.parseJSON(data);
                            if (result.flag == 'T') {
                                window.location.href = '${ctx}';
                            } else {
                                $.messager.alert('提交结果', result.msg, 'info');
                            }
                        },
                        error: function (data) {
                            alert("请检查服务器!");
                        }
                    });
                }
            });
        }
    </script>

    <style>

        h3 {
            width: 98%;
            border: 1px solid #eee;
            margin: 2px;
            margin-left: 2px;
            height: 20px;
            font-size: 12px;
            font-weight: normal;
            line-height: 20px;
            vertical-align: center;
            text-indent: 5px;
            cursor: pointer;
        }
    </style>
</head>
<body class="easyui-layout" style="overflow-y: hidden" scroll="no">
<div region="north" border="false"
     style="height: 80px; background: #a8d7e9;">
    <div id="top" class="top" region="north" border="false">
				<span style="float: left; line-height: 66px; font-size: 30px; font-family: 微软雅黑; color: #000000; text-shadow: 5px 5px 5px #0c4b09">
					&nbsp;&nbsp;&nbsp;&nbsp;${title!''}</span>
        <span style="float: right; padding: 4px;">
				<font color="#9282;">欢迎您：${userEname!''} | </font>
				<font color="#ddeeff">
                    <a href="#" onclick="lgnout();">退出系统</a> </font>
				</span>
    </div>
</div>
<div region="west" split="true" title="功能菜单列表" style="width: 190px; padding: 0px;">
    <div title="" iconCls="icon-undo">
        <h3 onclick="addTab('接口注册管理','${ctx}/protocol/list')">接口注册管理</h3>
        <h3 onclick="addTab('统一配管理','${ctx}/config/list')">统一配管理</h3>
        <h3 onclick="addTab('系统数据源管理','${ctx}/source/list')">系统数据源管理</h3>
       <!-- <h3 onclick="addTab('定时任务管理','${ctx}/task/list')">定时任务管理</h3> -->
    </div>
</div>
<div id="mainPanle" region="center" style="overflow: hidden;">
    <div id="maintabs" class="easyui-tabs" fit="true" border="false">
        <div class="easyui-tab" title="首页" href=""
             style="padding: 2px; overflow: hidden;">
            <div class="demo-info" style="margin-bottom: 10px">
                <div class="demo-tip icon-tip"></div>
                <div>
                ${title }
                </div>
            </div>
        </div>
    </div>
</div>
<!--div region="east" split="true" title="附加功能"
     style="width: 250px; padding: 10px;">
    <div class="demo-info" style="margin-bottom: 10px">
        <div class="demo-tip icon-tip"></div>
        <div>
            工作日历
        </div>
    </div>
    <div class="easyui-calendar" style="width: 180px; height: 180px;"></div>
    <br>
</div -->
<!-- 底部 -->
<div region="south" border="false" style="height: 25px; overflow: hidden;">
    <div align="center" style="padding-top: 2px">&copy; 版权所有 <span class="tip">${title}
        <label id="show"/> </span></div>
</div>
</body>

</html>